<script id="list-tpl" type="text/html"
        data-params='{"url":"/education/admin/question","dataName":"questionData","pageid":"#page", "method":"post"}'>
    <table id="example" class="layui-table lay-even" data-name="questionData" data-tplid="list-tpl">
        <thead>
            <tr>
                <th width="30"><input type="checkbox" id="checkall" data-name="checkbox" lay-filter="check"
                                      lay-skin="primary"></th>
                <th>咨询内容</th>
                <th width="100">咨询人</th>
                <th width="150">咨询时间</th>
                <th>回复内容</th>
                <th width="150">回复时间</th>
                <th width="80">公开状态</th>
                <th width="150">操作</th>
            </tr>
        </thead>
        <tbody>
            {{# layui.each(d.list, function(index, item){ }}
            <tr>
                <td><input type="checkbox" name="checkbox" value="{{ item.ids}}" lay-skin="primary"></td>
                <td>
                    {{# if(item.content == null){ }} {{#  } else { }} {{ item.content}}  {{#  } }}
                </td>
                <td>{{# if(item.createusername == null){ }} {{#  } else { }} {{ item.createusername }} {{#  } }}</td>
                <td>{{# if(item.createtime == null){ }} {{#  } else { }} {{
                    item.createtime.substring(0, item.createtime.lastIndexOf(':'))
                    }}  {{#  } }}
                </td>
                <td class="edit" data-list='{"key":"id={{ item.ids}}","filed":"answer","render":"true"}'
                    data-params='{"url":"/education/admin/question/answer", "data":"ids={{ item.ids}}" }'>
                    {{# if(item.answer == null){ }} {{#  } else { }} {{ item.answer}}  {{#  } }}
                </td>
                <td>{{# if(item.answertime == null){ }} {{#  } else { }} {{
                    item.answertime.substring(0, item.answertime.lastIndexOf(':'))
                    }}  {{#  } }}
                </td>
                <td><input type="checkbox" name="open" lay-skin="switch" lay-text="公开|屏蔽" {{#if (item.open =='1'){
                    }}checked="checked" {{# } }} lay-filter="ajax" value="1"
                    data-params='{"url":"/education/admin/question/update","data":"ids={{ item.ids}}"}'/>
                </td>
                <td>
                    <button class="layui-btn layui-btn-mini modal-catch"
                            data-params='{"content": ".add-subcat","area":"600px,400px","title":"回复{{ item.createusername}}","key":"ids={{ item.ids }}","type":"1"}'>
                        <i class="iconfont">&#xe653;</i>回复
                    </button>
                    <button class="layui-btn layui-btn-mini layui-btn-danger ajax"
                            data-list='{"key":"id={{ item.ids}}","msg":true,"render":"true","action":"del"}'
                            data-params='{"url": "/education/admin/question/delete","data":"ids={{ item.ids}}", "method":"post", "confirm":"true"}'>
                        <i class="iconfont">&#xe626;</i>删除
                    </button>
                </td>
            </tr>
            {{# }); }}
        </tbody>

    </table>
</script>